﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Web;

namespace SpotsHub.Tools.MassUploader
{
    public class PermissionController
    {
        public static string GetExternalIp()
        {
            string url = "http://checkip.dyndns.org/";
            WebClient webClient = new WebClient();
            Stream data = webClient.OpenRead(url);
            StreamReader reader = new StreamReader(data);
            string s = reader.ReadToEnd();
            s = s.Split(':')[1];
            s = s.Substring(1);
            string res = s.Split('<')[0];
            data.Close();
            reader.Close();

            return res;   
        }
    }
}
